package com.gljx.web.service.impl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.gljx.web.Entity.MakeupChargeEntry;
import com.gljx.web.dao.CommonDao;
import com.gljx.web.dao.MakeupChargeEntryMapper;
import com.gljx.web.service.MakeupChargeEntryService;

@Transactional
@Service
public class MakeupChargeEntryServiceImpl extends CommonDao implements MakeupChargeEntryService{

	@Autowired
	private MakeupChargeEntryMapper makeupChargeEntryMapper;
	
	
	/**
	 * 根据父类id查询
	 */
	@Override
	public List<MakeupChargeEntry> queryMakeupChargeEntryByFparentId(String fparentId,String studentName,String cfidcardno) {
		// TODO Auto-generated method stub
		  Map<String, Object> paramMap = new HashMap<String, Object>();
	      paramMap.put("v_fparentid", fparentId);
	      paramMap.put("v_studentName", studentName);
	      paramMap.put("v_cfidcardno", cfidcardno);
	      paramMap.put("v_cursor", oracle.jdbc.OracleTypes.CURSOR);
	      this.getSqlSession().select("com.gljx.web.dao.MakeupChargeEntryMapper.selectMakeupChargeEntryByFparentId", paramMap, null);
	      @SuppressWarnings("unchecked")
		  List<MakeupChargeEntry> makeupChargeEntries = (List<MakeupChargeEntry>) paramMap.get("v_cursor");
		return makeupChargeEntries;
	}

	/**
	 * 根据条件查询
	 */
	@Override
	public List<String> queryMakeupChargeEntryByInfo(String studentName, String cfidcardno) {
		// TODO Auto-generated method stub
		Map<String, String> map = new HashMap<>();
		map.put("studentName", studentName);
		map.put("cfidcardno", cfidcardno);
		return makeupChargeEntryMapper.selectMakeupChargeEntryByInfo(map);
	}

    /**
     * @Author lcx
     * @Date 2017/12/6 0006 下午 2:42
     * 查询学生的 交补考费次数: 交补考费总额
     */
    @Override
    public List<MakeupChargeEntry> selectCfkscsAndCfysje(String fid) {

        //查询学生的补考收费次数
        return makeupChargeEntryMapper.selectByStudentId(fid);
    }

    @Override
    public List<MakeupChargeEntry> selectMakeupChargeByInfo(String fcompanyid, String studentName, String cfidcardno, String cfkemu, String beginTime, String endTime) {
        Map<String, String> map = new HashMap<>();
        map.put("studentName", studentName);
        map.put("cfidcardno", cfidcardno);
        map.put("cfkemu", cfkemu);
        map.put("beginTime", beginTime);
        map.put("endTime", endTime);
        map.put("fcompanyid", fcompanyid);
        return makeupChargeEntryMapper.selectMakeupChargeByInfo(map);
    }

}
